package java虚拟机;

/**
 * @author juntao zhang
 */
public class JITCompilation {

  public final static int num = 15000;

  public int doubleValue(int i) {
    for (int j = 0; j < 100000; j++) {
    }
    return i * 2;
  }

  private long calcSum() {
    long sum = 0;
    for (int i = 0; i <= 100; i++) {
      sum += doubleValue(i);
    }
    return sum;
  }

  public static void main(String[] args) {
    JITCompilation jit = new JITCompilation();
    for (int i = 0; i < num; i++) {
      jit.calcSum();
    }
  }
}
